#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;


int main1() {

    int n; cin >> n;
    vector<int> v(n);

    int l = 0, r = 1, _min = INT_MAX;

    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
    }

    for (; r < n; l++, r++)
    {
        _min = min(v[r] - v[l], _min);
        if (_min == 0) break;
    }

    cout << _min << endl;
    return 0;
}


